package lab02.test09;

/**
 * Created by 婷婷 on 2017/10/19.
 */
public class Student {
    //属性：“学号”、“班号”、“姓名”、“性别”、“年龄”
    private int num;
    private String classes;
    private String name;
    private String sex;
    private int age;

    //运用get set方法获取学生属性值
    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    public String getClasses() {
        return classes;
    }

    public void setClasses(String classes) {
        this.classes = classes;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    //用toString 方法转化成字符串输出
    @Override
    public String toString() {
        String studentInfo = "学号："+getNum()+"\n班级："+getClasses()+"\n姓名："+getName()+"\n年龄："+getAge()+"\n性别："+getSex();
        return studentInfo;
    }
}
